<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<div id="chatBox">
    <display:table name="messagesList" id="message">
        <display:column>
            <c:out value='${message.user.login} [${message.timeStamp}]:'/>
        </display:column>
        <display:column style="width: 60%;">
            <c:out value='${message.message}'/>
        </display:column>
    </display:table>

    <c:if test="${not empty sessionScope.user}">
        <form:form commandName="message" action="${contextPath}addMessage/" method="POST">
            <form:label path="message">Текст:</form:label>
            <form:textarea path="message"></form:textarea><br/>
            <input type="submit" value="Отправить"/>
        </form:form>
    </c:if>

</div>